import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
      path: '/',
      name: 'Home',
      component: () => import('../views/Home.vue'),
      meta:{
        title:'宣传广告机'
      }
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

router.beforeEach((to, from, next) => {
	//改title
	if (to.meta.title) {
		document.title = to.meta.title
	}
	next();
	
});

export default router
